What is a Purely Functional Language?

نویسنده

  • Amr Sabry
چکیده

Functional programming languages are informally classified into pure and impure languages. The precise meaning of this distinction has been a matter of controversy. We therefore investigate a formal definition of purity. We begin by showing that some proposed definitions which rely on confluence, soundness of the beta axiom, preservation of pure observational equivalences and independence of the order of evaluation, do not withstand close scrutiny. We propose instead a definition based on parameter-passing independence. Intuitively, the definition implies that functions are pure mappings from arguments to results; the operational decision of how to pass the arguments is irrelevant. In the context of Haskell, our definition is consistent with the fact that the traditional call-by-name denotational semantics coincides with the traditional call-by-need implementation. Furthermore, our definition is compatible with the stream-based, continuation-based and monad-based integration of computational effects in Haskell. Finally, we observe that call-by-name reasoning principles are unsound in compilers for monadic Haskell.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Lambda in Motion: Controlling Robots with Haskell

We present our experiences using a purely functional language , Haskell, in what has been traditionally the realm of low-level languages: robot control. Frob (Functional Robotics) is a domain-speciic language embedded in Haskell for robot control. Frob is based on Functional Reactive Programming (FRP), as initially developed for Fran, a language of reactive animations. Frob presents the interac...

متن کامل

Stephen Hawking's Community-Bound Voice A Functional Investigation of Self-Mentions in Stephen Hawking's Scientific Prose

Thanks to the development of the concept of metadiscourse, it is now widely acknowledged that academic/scientific writing is not only concerned with communicating purely propositional meanings: what is communicated through academic/scientific communication is seen to be intertwined with the negotiation of social and interpersonal meanings. While a large number of so called metadiscoursal resour...

متن کامل

Ethnomethodology and Conversational Analysis

In a speech community, people utilize their communicative competence which they have acquired from their society as part of their distinctive sociolinguistic identity. They negotiate and share meanings, because they have commonsense knowledge about the world, and have universal practical reasoning. Their commonsense knowledge is embodied in their language. Thus, not only does social life depend...

متن کامل

Purely Functional Monadic Scheme

This paper describes a purely functional dialect of the algorithmic programming language Scheme. Mutable variables, assignment operations and impure control operations (call-with-current-continuation) have been omitted, while side effecting input and output operations are incorporated into the purely functional language using monads, similar to the approach taken in the lazy programming languag...

متن کامل

Purely Functional Structured Programming

The idea of functional programming has played a big role in shaping today’s landscape of mainstream programming languages. Another concept that dominates the current programming style is Dijkstra’s structured programming. Both concepts have been successfully married, for example in the programming language Scala. This paper proposes how the same can be achieved for structured programming and pu...

متن کامل

Delimiting the Scope of Eeects

Program fragments in functional languages may be observationally congruent in a language without eeects (continuations, state, exceptions) but not in an extension with eeects. We give a generic way to preserve pure functional congruences by means of an eeects delimiter. The eeects delimiter is deened semantically using the retraction techniques of 14], but can also be given an operational seman...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • J. Funct. Program.

دوره 8  شماره 

صفحات  -

تاریخ انتشار 1998